<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/WEB-INF/maa.tld" prefix="m" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<fmt:setLocale value="${language}"/>
<fmt:bundle basename="messages" prefix="coursecreation.">
    <html>

    <head>
        <title><fmt:message key="title"/></title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <meta name="viewport" content="width=device-width">
        <link rel="stylesheet" href="${pageContext.servletContext.contextPath}/static/bootstrap/css/bootstrap.css">
        <link href="${pageContext.request.contextPath}/css/course-creation.css" rel="stylesheet">
        <link rel="shortcut icon" href="${pageContext.servletContext.contextPath}/static/yin.ico">
        <script type="text/javascript"
                src="${pageContext.servletContext.contextPath}/static/bootstrap/js/bootstrap.min.js"></script>
        <style type="text/css">

        </style>

    </head>

    <body>
    <div class="navbar-wrapper">
        <div class="container-fluid">
            <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
                <div class="container">
                    <div class="navbar-header">
                        <button type="button" class="navbar-toggle" data-toggle="collapse"
                                data-target=".navbar-collapse">
                            <span class="sr-only">Toggle navigation</span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                        </button>
                        <a class="navbar-brand" href="/maa/do?action=main"> <img
                                src="${pageContext.servletContext.contextPath}/static/ics.png"/>Silver Dragon</a>
                    </div>
                    <div class="navbar-collapse collapse">
                        <ul class="nav navbar-nav navbar-right">
                            <li><a><strong><fmt:message key="greet"/> ${user.name} ${user.surname}!</strong></a></li>
                            <m:language/>
                            <li>
                                <form action="/maa/do" method="post">
                                    <input type="hidden" name="action" value="logout">
                                    <input class="btn btn-default navig" type="submit"
                                           value="<fmt:message key="logout"/>"/>
                                </form>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="container-fluid">
        <div class="row">
            <div class="col-sm-3 col-md-2 sidebar">
                <ul class="nav nav-sidebar">
                    <li><h4><fmt:message key="overview"/></h4></li>
                    <li><a href="/maa/do?action=view-courses"><fmt:message key="courses"/></a></li>
                    <li><a href="/maa/do?action=view-users"><fmt:message key="clients"/></a></li>
                    <li><a href="/maa/do?action=view-mentors"><fmt:message key="mentors"/></a></li>
                </ul>
                <ul class="nav nav-sidebar">
                    <li><h4><fmt:message key="create"/></h4></li>
                    <li><a href="/maa/do?action=course-creation"><fmt:message key="newc"/></a></li>
                    <li><a href="/maa/do?action=user-creation"><fmt:message key="newu"/></a></li>
                </ul>
            </div>
            <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
                <h1 class="page-header"><fmt:message key="title"/></h1>

                <div class="container">
                    <form class="form-signin" action="/maa/do" method="post">
                        <h2 class="form-signin-heading"><fmt:message key="title"/></h2>

                        <c:if test="${not empty incorrect_description}">
                            <%=request.getAttribute("incorrect_description")%>
                        </c:if>
                        <c:if test="${not empty incorrect_name}">
                            <%=request.getAttribute("incorrect_name")%>
                        </c:if>
                        <c:if test="${not empty incorrect_price}">
                            <%=request.getAttribute("incorrect_price")%>
                        </c:if>

                        <p><fmt:message key="name"/></p>
                        <input type="text" name="courseName" class="form-control input-lg">

                        <p><fmt:message key="descr"/></p>
                        <textarea name="courseDescription" class="form-controll"></textarea>

                        <p><fmt:message key="price"/></p>
                        <input type="double" name="price" class="form-control">

                        <p><fmt:message key="mentor"/></p>
                        <select id="mentor" name="mentor" class="form-control">
                            <c:forEach items="${mentors}" var="mentor">
                                <option value=${mentor.uuid}>${mentor}</option>
                            </c:forEach>
                        </select>

                        <button class="btn btn-lg btn-block" type="submit"><fmt:message key="create"/></button>
                        <input type="hidden" name="action" value="create-course">
                    </form>
                    <form class="form-signin" action="/maa/do" method="get">
                        <button class="btn btn-lg btn-block" type="submit"><fmt:message key="return"/></button>
                        <input type="hidden" name="action" value="admin-cabinet">
                    </form>
                </div>
            </div>
        </div>
    </div>

    </body>
    </html>
</fmt:bundle>


